//
//  AppDelegatePresenter.m
//  StockpdfReading
//
//  Created by mac on 2017/7/21.
//  Copyright © 2017年 上海LOL信息技术服务有限公司. All rights reserved.
//

#import "AppDelegatePresenter.h"
#import <AVOSCloud.h>
#import <AFNetworking.h>

@interface AppDelegatePresenter()

@property (nonatomic,strong) NSString *tempurl;

@end

@implementation AppDelegatePresenter

-(void)requestAppStartBlock:(ResultBlock)block{
    NSString * currentversion = [NSBundle mainBundle].infoDictionary[@"CFBundleShortVersionString"];
    AVQuery *query = [AVQuery queryWithClassName:@"AppCheck"];
    [query whereKey:@"appVersion" equalTo:currentversion];
    [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
        if (!error && objects.count > 0) {
            AVObject *object = objects.firstObject;
            self.isinCheck = [NSString stringWithFormat:@"%@",object[@"isCheck"]];
            self.urlstring = [NSString stringWithFormat:@"%@",object[@"urlString"]];
            block(YES,nil);
        }else{
            block(NO,error);
        }
    }];
}






@end





